home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacFormat 1995 March
/
macformat-022.iso
/
Shareware City
/
Developers
/
src
/
bbedit-30-dev-kit.hqx
/
BBEdit 3.0 Extension Dev. Kit
/
Examples
/
HelloWorld.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1994-02-13
|
429 b
|
20 lines
#include "ExternalInterface.h"
/*
This trivial extension shows the use of NewDocument(),
Allocate(), and SetWindowContents().
*/
pascal void main(ExternalCallbackBlock *callbacks, WindowPtr w)
{
Handle h;
w = callbacks->NewDocument();
if (w) {
h = callbacks->Allocate(0, FALSE);
SetIText(h, "\pHello World");
callbacks->SetWindowContents(w, h);
// do NOT dispose of "h", since it now belongs to the window!
}
}